import Vue from "vue";
import Vuex from "vuex";
import state from "./state";
import getters from "./getters";
import mutations from "./mutations";
import actions from "./actions";
import permission from "./permission";
import VuexPersistence from "vuex-persist";
import shop from './shop'
import user from './user'
import home from './home'
import order from './order'

// console.log(shop.state.refreshShopTime);
const vuexLocal = new VuexPersistence({
  storage: window.localStorage,
});

Vue.use(Vuex);

export default new Vuex.Store({
  state,
  getters,
  mutations,
  actions,
  modules: {
    permission,
    shop,
    user,
    home,
    order
  },
  plugins: [vuexLocal.plugin],
});
